package com.flyfox.modules.user;

import com.flyfox.jfinal.base.SessionUser;
import com.flyfox.jfinal.component.annotation.ModelBind;
import com.flyfox.jfinal.component.template.CRUD;
import com.flyfox.jfinal.component.template.ModelAttr;

@ModelBind(table = "sys_user", key = "userid")
public class SysUser extends SessionUser<SysUser> {

	private static final long serialVersionUID = 1L;
	public static final SysUser dao = new SysUser();
	public static final CRUD crud = new CRUD();

	static {
		crud.setPrimaryKey("userid");
		crud.setUrlKey("user");
		crud.setName("用户");
		crud.setAttr(new ModelAttr().setKey("username").setName("登陆名").addSearch().setFormTypeVaild("required='required'"));
		crud.setAttr(new ModelAttr().setKey("realname").setName("真实姓名").addSearch());
	}
	public Integer getUserid() {
		return getInt("userid") == null ? -1 : getInt("userid");
	}
}
